-
-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat/split extension package #30
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
一些修改建议我写在对应的代码处了,下面几点还需要再补充下的:
wormhole
里还需要用commander
增加命令- 子包的打包,vscode插件可以和之前一样用esbuild,
wormhole
就直接用tsc
命令编译就行了,因为是node包,不需要再打包成一个文件。 - 建议
templates
子包可以作为一个文件夹合并到wormhole
中。
.npmrc
Outdated
recursive-install = true | ||
# 使用淘宝镜像源 | ||
registry = https://registry.npmmirror.com |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个最好不用设置,到时我们配置github actions后是在github服务器上安装依赖的
package.json
Outdated
"displayName": "Alova", | ||
"description": "Generate and search APIs without API documentation any more", | ||
"version": "0.0.10", | ||
"description": "The devtools for alova.js", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个描述是我改的😂
packages/wormhole/package.json
Outdated
"author": "", | ||
"license": "ISC", | ||
"dependencies": { | ||
"@alova/templates": "workspace:^" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
templates这个子包我感觉可以直接放在wormhole里面,因为它只会用在这一个地方,而不是通用的或需要发布的
packages/wormhole/package.json
Outdated
"main": "src/index.ts", | ||
"module": "src/index.ts", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里一般需要写编译之后的文件
"name": "@alova/wormhole", | ||
"version": "1.0.0", | ||
"description": "generate api for alova.js", | ||
"homepage": "https://alova.js.org", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
还缺一个types
指定这个包导出的函数对应的声明文件,这个声明文件一般是typings/index.d.ts(我现在都是这样做的,可以统一下)
packages/wormhole/src/index.ts
Outdated
export * from './generate'; | ||
export { default as Configuration } from './modules/Configuration'; | ||
export * from './readConfig'; | ||
export * from './type'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
type类型不需要在这里导出,指定package.json下的types字段就可以了
packages/wormhole/src/index.ts
Outdated
export * from './config'; | ||
export * from './createConfig'; | ||
export * from './functions/alovaJson'; | ||
export * from './functions/openApi2Data'; | ||
export * from './generate'; | ||
export { default as Configuration } from './modules/Configuration'; | ||
export * from './readConfig'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 这里不需要全部都对外暴露,我们只暴露几个预先说好的那几个函数就好了,其他的暴露后后面要改就比较麻烦了
- 对应的类型声明文件里也需要定义暴露的类型声明
同时优化了mergeObject方法,处理嵌套结构时,可以最大程度复用
Test/splited test vitest
bfab345
to
ea7076d
Compare
…epo查找 我这边也基本测完了,这是我整理的几个优化点,然后就可以发布了。
Test/splited test vitest
…api files as generation sources
…vajs/devtools into test/splited-test-vitest
…vajs/devtools into feat/split-extension-package
…split-extension-package
1.拆分wormhole包
2.拆出templates包
3.work改造